import Vue from 'vue'
import Router from 'vue-router'
import App from '@/views/layout/App.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [{
    path: '/',
    name: 'layout',
    component: App,
    children: [{
        path: '/main',
        name: 'main',
        meta: {
          requiresAuth: true
        },
        component: () => import('@/views/layout/Main.vue')
      }, {
        path: '/code',
        name: '代码浏览',
        meta: {
          requiresAuth: true
        }
      },
      {
        name: '分支管理',
        path: '/Branch',
        meta: {
          requiresAuth: true
        }
      },
      {
        name: '版本合并',
        path: '/hebing',
        meta: {
          requiresAuth: true
        }
      },
      {
        name: '请求处理',
        path: '/request',
        meta: {
          requiresAuth: true
        }
      },
      {
        name: '个人中心',
        path: '/userinfo',
        meta: {
          requiresAuth: true
        }
      }
    ]
  }]
})